package com.mccken.springframework.beans;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-11-29 15:24
 **/
public class PropertyValues {

	private final List<PropertyValue> propertyValueList = new ArrayList<>();

	public void addPropertyValue(PropertyValue pv) {
		this.propertyValueList.add(pv);
	}

	public PropertyValue[] getPropertyValues() {
		return this.propertyValueList.toArray(new PropertyValue[0]);
	}

	public PropertyValue getPropertyValue(String PropertyName) {
		for (PropertyValue pv : this.propertyValueList) {
			if (pv.getName().equals(PropertyName)) {
				return pv;
			}
		}
		return null;
	}
}
